import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/pages/layout/Layout'

Vue.use(Router)

export default new Router({
  // mode: 'history', //去掉地址栏的#号
  routes: [
    {
      path: '/login',
      name: '智能货架代理商后台管理系统',
      component: (resolve) => require(['@/pages/login/Login'], resolve),
      meta: {
        title: '智能货架代理商后台管理系统',
        requireLogin: false
      }
    },
    {
      path: '/',
      name: '主页面',
      component: Layout,
      redirect: '/login',
      children: [
        {
          path: 'home',
          name: '首页',
          component: (resolve) => require(['@/pages/home/Home'], resolve),
          meta: {
            title: '首页',
            requireLogin: true
          }
        },
        {
          path: 'home/orderadmin/sellorder',
          name: '销售订单',
          component: (resolve) => require(['@/pages/orderAdmin/SellOrder'], resolve),
          meta: {
            title: '销售订单',
            requireLogin: true
          }
        },
        {
          path: 'home/orderadmin/sellorder/selldetails',
          name: '销售订单详情',
          component: (resolve) => require(['@/pages/orderAdmin/SellDetails'], resolve),
          meta: {
            title: '销售订单详情',
            requireLogin: true
          }
        },
        {
          path: 'home/orderadmin/aftersaleindent',
          name: '售后订单',
          component: (resolve) => require(['@/pages/orderAdmin/AfterSaleIndent'], resolve),
          meta: {
            title: '售后订单',
            requireLogin: true
          }
        },
        {
          path: 'home/orderadmin/aftersaleindent/aftersaledetails',
          name: '售后订单详情',
          component: (resolve) => require(['@/pages/orderAdmin/AfterSaleDetails'], resolve),
          meta: {
            title: '售后订单详情',
            requireLogin: true
          }
        },
        {
          path: 'home/orderadmin/abnormalorders',
          name: '异常订单',
          component: (resolve) => require(['@/pages/orderAdmin/AbnormalOrders'], resolve),
          meta: {
            title: '异常订单',
            requireLogin: true
          }
        },
        {
          path: 'home/orderadmin/abnormalorders/abnormaldetails',
          name: '异常订单详情',
          component: (resolve) => require(['@/pages/orderAdmin/AbnormalDetails'], resolve),
          meta: {
            title: '异常订单详情',
            requireLogin: true
          }
        },
        {
          path: 'home/repertoryadmin/repertoryinquire',
          name: '库存查询',
          component: (resolve) => require(['@/pages/repertoryAdmin/RepertoryInquire'], resolve),
          meta: {
            title: '库存查询',
            requireLogin: true
          }
        },
        {
          path: 'home/repertoryadmin/updowngoods',
          name: '上下货记录',
          component: (resolve) => require(['@/pages/repertoryAdmin/upDownGoods'], resolve),
          meta: {
            title: '上下货记录',
            requireLogin: true
          }
        },
        //补货单
        {
          path: 'home/repertoryadmin/repairinvoice',
          name: '补货单',
          component: (resolve) => require(['@/pages/repertoryAdmin/Repairinvoice'], resolve),
          meta: {
            title: '补货单',
            requireLogin: true
          }
        },
        //补货单

        //补货单详情
        {
          path: 'home/repertoryadmin/repairinvoice/createrepaire',
          name: '补货单详情',
          component: (resolve) => require(['@/pages/repertoryAdmin/createRepaire'], resolve),
          meta: {
            title: '补货单详情',
            requireLogin: true
          }
        },
        //补货单详情

        //补货单创建页面
        {
          path: 'home/repertoryadmin/repairinvoice/realcreat',
          name: '补货单创建',
          component: (resolve) => require(['@/pages/repertoryAdmin/realcreat'], resolve),
          meta: {
            title: '补货单创建',
            requireLogin: true
          }
        },
        //补货单创建页面

        {
          path: 'home/repertoryadmin/backinvoice',
          name: '回货单',
          component: (resolve) => require(['@/pages/repertoryAdmin/backinvoice'], resolve),
          meta: {
            title: '回货单',
            requireLogin: true
          }
        },
        //回货单详情页面
        {
          path: 'home/repertoryadmin/backinvoice/detailinvoice',
          name: '回货单详情',
          component: (resolve) => require(['@/pages/repertoryAdmin/detailinvoice'], resolve),
          meta: {
            title: '回货单详情',
            requireLogin: true
          }
        },
        //回货单编辑页面
        {
          path: 'home/repertoryadmin/backinvoice/editinvoice',
          name: '回货单编辑',
          component: (resolve) => require(['@/pages/repertoryAdmin/editinvoice'], resolve),
          meta: {
            title: '回货单编辑',
            requireLogin: true
          }
        },

        {
          path: 'home/goodsadmin/allgoods',
          name: '商品库',
          component: (resolve) => require(['@/pages/goodsAdmin/AllGoods'], resolve),
          meta: {
            title: '商品库',
            requireLogin: true
          }
        },
        {
          path: 'home/goodsadmin/templateadmin',
          name: '模板管理',
          component: (resolve) => require(['@/pages/goodsAdmin/TemplateAdmin'], resolve),
          meta: {
            title: '模板管理',
            requireLogin: true
          }
        },
        {
          path: 'home/goodsadmin/templateadmin/templateedit',
          name: '模板编辑',
          component: (resolve) => require(['@/pages/goodsAdmin/TemplateEdit'], resolve),
          meta: {
            title: '模板编辑',
            requireLogin: true
          }
        },
        {
          path: 'home/goodsadmin/templateadmin/templateadd',
          name: '新增模板',
          component: (resolve) => require(['@/pages/goodsAdmin/TemplateAdd'], resolve),
          meta: {
            title: '新增模板',
            requireLogin: true
          }
        },
        {
          path: 'home/networkadmin/networkadminson',
          name: '网点管理',
          component: (resolve) => require(['@/pages/networkAdmin/NetworkAdmin'], resolve),
          meta: {
            title: '网点管理',
            requireLogin: true
          }
        },
        {
          path: 'home/networkadmin/poitionadmin',
          name: '点位管理',
          component: (resolve) => require(['@/pages/networkAdmin/PoitionAdmin/PoitionAdmin.vue'], resolve),
          meta: {
            title: '点位管理',
            requireLogin: true
          }
        },
        {
          path: 'home/networkadmin/poitionadmin/poitionadd',
          name: '新增点位',
          component: (resolve) => require(['@/pages/networkAdmin/PoitionAdd'], resolve),
          meta: {
            title: '新增点位',
            requireLogin: true
          }
        },
        {
          path: 'home/networkadmin/poitionadmin/poitionedit',
          name: '编辑点位',
          component: (resolve) => require(['@/pages/networkAdmin/PoitionEdit'], resolve),
          meta: {
            title: '编辑点位',
            requireLogin: true
          }
        },
        {
          path: 'home/partneradmin/partneradminson',
          name: '合作方管理',
          component: (resolve) => require(['@/pages/partnerAdmin/PartnerAdmin'], resolve),
          meta: {
            title: '合作方管理',
            requireLogin: true
          }
        },
        {
          path: 'home/partneradmin/balancecollect',
          name: '合作方余额汇总',
          component: (resolve) => require(['@/pages/partnerAdmin/BalanceCollect'], resolve),
          meta: {
            title: '合作方余额汇总',
            requireLogin: true
          }
        },
        {
          path: 'home/partneradmin/withdraw',
          name: '合作方提现',
          component: (resolve) => require(['@/pages/partnerAdmin/Withdraw'], resolve),
          meta: {
            title: '合作方提现',
            requireLogin: true
          }
        },
        {
          path: 'home/partneradmin/partnerBill',
          name: '合作方账单',
          component: (resolve) => require(['@/pages/partnerAdmin/partnerBill'], resolve),
          meta: {
            title: '合作方账单',
            requireLogin: true
          }
        },
        
        {
          path: 'home/networkadmin/mydevice',
          name: '我的设备',
          component: (resolve) => require(['@/pages/networkAdmin/MyDevice'], resolve),
          meta: {
            title: '我的设备',
            requireLogin: true
          }
        },
        {
          path: 'home/networkadmin/inspectoradmin',
          name: '巡柜员管理',
          component: (resolve) => require(['@/pages/networkAdmin/InspectorAdmin'], resolve),
          meta: {
            title: '巡柜员管理',
            requireLogin: true
          }
        },
        {
          path: 'home/containerlog',
          name: '货柜日志',
          component: (resolve) => require(['@/pages/containerLog/ContainerLog'], resolve),
          meta: {
            title: '货柜日志',
            requireLogin: true
          }
        },
        {
          path: 'home/financeadmin/residualadmin',
          name: '余额管理',
          component: (resolve) => require(['@/pages/financeAdmin/ResidualAdmin'], resolve),
          meta: {
            title: '余额管理',
            requireLogin: true
          }
        },
        {
          path: 'home/financeadmin/withdrawadmin',
          name: '提现管理',
          component: (resolve) => require(['@/pages/financeAdmin/withdrawAdmin'], resolve),
          meta: {
            title: '提现管理',
            requireLogin: true
          }
        },
        {
          path: 'home/financeadmin/mybill',
          name: '我的账单',
          component: (resolve) => require(['@/pages/financeAdmin/MyBill'], resolve),
          meta: {
            title: '我的账单',
            requireLogin: true
          }
        },
        {
          path: 'home/accessadmin/peopleadmin',
          name: '人员管理',
          component: (resolve) => require(['@/pages/accessAdmin/PeopleAdmin'], resolve),
          meta: {
            title: '人员管理',
            requireLogin: true
          }
        },
        {
          path: 'home/accessadmin/roleadmin',
          name: '角色管理',
          component: (resolve) => require(['@/pages/accessAdmin/RoleAdmin'], resolve),
          meta: {
            title: '角色管理',
            requireLogin: true
          }
        },
      ]
    },
    // 输入不存在地址跳转首页
    // {
    //   path: '*',
    //   name: '输入不存在地址跳转首页',
    //   redirect: '/'
    // },
  ]
})

